export function wrapperEnv(envConf: Recordable<string>): ViteEnv {
	const result: any = {}
	for (const envName of Object.keys(envConf)) {
		let realName: any = envConf[envName].replace(/\\n/g, '\n')

		if (/^VITE_B_/.test(envName)) {
			realName = realName === 'true' ? true : realName === 'false' ? false : realName
		} else if (/^VITE_N_/.test(envName)) {
			realName = Number(realName)
		} else if (/^VITE_A_/.test(envName)) {
			try {
				realName = JSON.parse(realName)
			} catch (error) {
				console.log('wrapperEnv error：', error)
			}
		}
		result[envName] = realName
		process.env[envName] = realName
	}
	return result
}
